package com.xiaotu.impRunnable;

import com.xiaotu.exThread.ExtendsTread;

/**
 * @Author xiaotu
 * @Description //TODO
 * @Date 2022/3/24 16:56
 * @ClassName MyRunnable01
 * @Version 1.0
 **/
//创建线程方法二:实现Runnabel接口,重写run方法,执行线程需要丢入runnable接口实现类,调用start方法
public class MyRunnable01 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 32; i++) {
            System.out.println("我在执行多线程=====>"+i+Thread.currentThread().getName());
        }
    }
    public static void main(String[] args) {
        //创建实现Runnable接口的实现类对象
        MyRunnable01 t1 = new MyRunnable01();
        //创建线程对象,通过线程对象来开启我们的 线程代理
        Thread thread01 = new Thread(t1);
        thread01.start();
        for (int i = 0; i < 33; i++) {
            System.out.println("我在执行主函数=-=====>>"+i+Thread.currentThread().getName());
        }
    }
}
